<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>delete.js</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../css/github.css" type="text/css" media="screen" />
<script src="../../../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
    <div class="banner">
        
        <h1>
            delete.js
        </h1>
        <ul class="files">
            
            <li>
                lib/assets/javascripts/ruiqu_app/store_friends/delete.js
                
            </li>
            <li>Last modified: 2017-01-04 10:35:26 +0800</li>
        </ul>
    </div>

    <div id="bodyContent">
        <div id="content">
  
    <div class="description">
      
<p>jQuery(function($){</p>

<pre><code>$(&quot;a.js-to-remove-friend&quot;).on(&quot;click&quot;, function(){
  BootstrapDialog.confirm(&#39;确定删除该好友吗？&#39;, function(result){
    if(result) {
      var _this = this
      var friendID = $(this).data(&quot;id&quot;);
      $.ajax({
        url: &quot;/api/store_friends/&quot;+ friendID +&quot;/unfriend&quot;,
        method: &#39;get&#39;,
        data: {friend_id: friendID},
        success: function(data){
          if(data.status == true){
            $(_this).parent().parent().remove();
          }
        }
      }) //ajax end

    };
  });

});</code></pre>

<p>})</p>

    </div>
  


  


  
  


  


  

  



  

    

    

    


    


    <!-- Methods -->
              </div>

    </div>
  </body>
</html>
